supplier

@ApiStatus.Experimental
abstract fun supplier(scope: String, config: Config, thing: Any, property: KMutableProperty<*>): Supplier<T>

Creates a result supplier from config values. Since configs are by design mutable in-game, the result should freshly inspect the value on every get().

  • If the thing is a ValidatedField or otherwise a supplier of values, it can be used directly to provide a supplier of values

  • If the thing is a basic primitive or object, the property should be used to supply values from the properties getter

Using this general strategy ensures that fresh values are supplied on every call.

Return

Supplier<T> supplier instance for retrieving values from the config scope provided.

Author

fzzyhmstrs

Since

0.5.3

Parameters

scope

String representation of a config setting. See the translation wiki page for an overview of how scopes work.

args

List optionally provided args appended to the provided scope. The scope parameter also technically contains these, pre-processing

config

Config the config instance providing results

thing

Any the candidate result to potentially use to create the supplier with.

property

KMutableProperty reflection property instance for the thing